package util.hilo;

import java.text.SimpleDateFormat;
import java.util.Date;

import javax.swing.JLabel;
import javax.swing.JTextField;

public class Hilo03 extends Thread {
	
	private JTextField lblAux;
	
	public Hilo03(JTextField lblAux){
		this.lblAux =lblAux; 
	}
	
	public void run() {
		
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		while(true){
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			
			lblAux.setText(""+ sdf.format(new Date()));
		}
		
	}

}
